<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="stylesheet" href="{{ url_for('static', filename='bootstrap/bootstrap.css') }}">
    <link rel="stylesheet" href="{{ url_for('static', filename='css/init.css') }}">
    <link rel="stylesheet" href="{{ url_for('static', filename='css/index.css') }}">
    <link rel="stylesheet" href="{{ url_for('static', filename='css/bootstrap-grid.css') }}">
    <link rel="stylesheet" href="{{ url_for('static', filename='css/bootstrap-reboot.css') }}">
    <link {% block link %}{% endblock %}>
    {% block head %}{% endblock %}
    <title>{% block title %}{% endblock %}</title>
</head>

<body>
<nav class="navbar navbar-expand-lg fixed-top navbar-light bg-light" style="background-color: #e3f2fd;">
    <a class="navbar-brand" href="#">
        <img src="{{ url_for('static', filename='images/img/logo.png') }}" width="130px" class="d-inline-block align-top"
             alt="">
    </a>
    <div class="container">
        <a class="navbar-brand" href="#">商职表白墙</a>
        <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent"
                aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
            <span class="navbar-toggler-icon"></span>
        </button>
        <div class="collapse navbar-collapse" id="navbarSupportedContent">
            <ul class="navbar-nav mr-auto">
                <li class="nav-item active">
                    <a class="nav-link" href="/">首页<span class="sr-only">(current)</span></a>
                </li>
                <li class="nav-item">
                    <a class="nav-link" href="{{ url_for('Post.public_question') }}">发布帖子</a>
                </li>
                <li class="nav-item ml-2">
                    <form class="form-inline my-2 my-lg-0" method="GET" action="{{ url_for('Post.search') }}">
                        <input class="form-control mr-sm-2" type="search" placeholder="关键字" aria-label="Search"
                               name="q">
                        <button class="btn btn-outline-success my-2 my-sm-0" type="submit">搜索</button>
                    </form>
                </li>
            </ul>
            <ul class="navbar-nav">
                {% if user %}
                    <li class="nav-item">
                        <a href="{{ url_for('Post.user_images') }}"><img
                                src="{{ url_for('static', filename='images/img/Google_Ax.png') }}" alt="{{ user.username }}"
                                class="side-question-avatar"></a>
                        <span class="btn btn-primary" style="margin-right:4px;">{{ user.username }}</span>
                    </li>
                    <li class="nav-item">
                        <button class="btn btn-outline-danger" data-toggle="modal"
                                data-target="#exampleModal" style="margin-top:6px;">
                            <a href="{{ url_for('User_Auth.logout') }}">退出登录</a>
                        </button>

                        <div class="modal fade" id="exampleModal" tabindex="-1" aria-labelledby="exampleModalLabel"
                             aria-hidden="true">
                            <div class="modal-dialog modal-dialog-centered">
                                <div class="modal-content">
                                    <div class="modal-header">
                                        <h5 class="modal-title" id="exampleModalLabel">你确定要退出登录吗？</h5>
                                        <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                                            <span aria-hidden="true">&times;</span>
                                        </button>
                                    </div>
                                    <div class="modal-body">
                                        <p>怎么 你吃完瓜了？ <img src="{{ url_for('static', filename='images/img/watermelon.png') }}" alt="" width="8%"></p>
                                        <p>怎么 你找到男朋友(女朋友)了？ <img src="{{ url_for('static', filename='images/img/lovers.png') }}" alt=""
                                                                             width="10%"></p>
                                        <p>你一键三连了？ <img src="{{ url_for('static', filename='images/img/triple.png') }}" alt="" width="25%"></p>
                                    </div>
                                    <div class="modal-footer">
                                        <button type="button" class="btn btn-success" data-dismiss="modal">取消</button>
                                        <a class="btn btn-danger" href="{{ url_for('User_Auth.logout') }}">确认退出</a>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </li>
                {% else %}
                    <li class="nav-item">
                        <a class="btn btn-outline-primary" href="{{ url_for('User_Auth.login') }}"
                           style="margin-right:4px;">登录</a>
                    </li>
                    <li class="nav-item">
                        <a class="btn btn-outline-primary" href="{{ url_for('User_Auth.register') }}">注册</a>
                    </li>
                {% endif %}
            </ul>
        </div>
    </div>
</nav>

<div class="container">
    {% block body %}{% endblock %}
</div>
<script src="{{ url_for('static', filename='js/jquery-3.7.1.min.js') }}"></script>
<script src="{{ url_for('static', filename='js/bootstrap.bundle.js') }}"></script>
<script src="{{ url_for('static', filename='js/js/bootstrap.js') }}"></script>
</body>

</html>